<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
 * File Uploading Class   上传类扩展
 *
 * @package		CodeIgniter
 * @subpackage	Libraries
 * @category	Uploads
 * @author		ExpressionEngine Dev Team
 * @link		http://taygod.com
 */
class Lin_Upload extends CI_Upload {
	
		/**
		  * Set Upload Path
		  * 自动生成上传目录
		  * @access public
		  * @param string
		  * @return void
		  */
		function set_upload_path($path)
		{
			
		  if (!is_dir($path) && $path!='./' && $path!='../') {
		   $dirname = '';
		   $folders = explode('/',$path);
		   foreach ($folders as $folder) {
		    $dirname .= $folder . '/';
		    if ($folder!='' && $folder!='.' && $folder!='..' && !is_dir($dirname)) {
		     mkdir($dirname);
		    }
		   }
		   chmod($path,0777);
		  }
		  // Make sure it has a trailing slash
		  $this->upload_path = rtrim($path, '/').'/';
		}
	
	
	
	
}